<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>出库管理</title>
<meta name="decorator" content="default" />
<style type="text/css">
</style>
<script type="text/javascript">
	$(document).ready(function() {
		$("#contentTable tbody tr").click(function() {
			$("#contentTable tbody tr").removeClass("select_active");
			$(this).addClass("select_active");
		});
	});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<div class="container">
		<div class="icon-buttons">
			<a data-role="button" data-inline="true" data-icon="back"
				data-iconpos="notext" href="${ctx}">返回</a>
		</div>
		<form:form id="searchForm" modelAttribute="outQuery"
			action="${ctx}/inventory/out/query" method="post" class="form-input">
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
			<input id="pageSize" name="pageSize" type="hidden"
				value="${page.pageSize}" />

			<label>开始日期：</label>
			<form:input type="date" id="startDate" name="startDate"
				path="startDate" />
			<label>结束日期：</label>
			<form:input type="date" id="endDate" name="endDate" path="endDate" />
			<input data-inline="true" type="submit" value="查询提货出库" />
		</form:form>
		<a href="${ctx}/inventory/out/create" data-inline="true"
				data-role="button">新增提货出库</a>
		<tags:message content="${message}" />
		<c:if test="${not empty outQuery.storeInventoryOuts}">
			<table id="contentTable" data-role="table"
				class="ui-responsive table-stroke">
				<thead>
					<tr>
						<th colspan="5" style="text-align:center;">提货出库单</th>
					</tr>
					<tr>
						<th>出库日期</th>
						<th>出库人</th>
						<th>产品数量</th>
						<th>合计零售价</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${outQuery.storeInventoryOuts}" var="out">
						<tr>
							<td>${fns:formatDate(out.outDate, 'yyyy-MM-dd HH:mm:ss')}</td>
							<td>${out.employee.name}</td>
							<td>${out.amount}</td>
							<td>${out.amount}</td>
							<td><button data-inline="true" data-role="button"
									onclick="directOpenURL('${ctx}/inventory/out/detail?id=${out.id}')">查看明细</button>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<div class="pagination">${page}</div>
		</c:if>
	</div>
</body>
</html>
